package com.yunxi.service.localService.vehicle.impl;

import com.yunxi.core.service.ServiceImplPlus;
import com.yunxi.dao.vehicle.VehicleConfigVerMapper;
import com.yunxi.model.vehicle.VehicleConfigVer;
import com.yunxi.service.localService.vehicle.VehicleConfigVerService;
import com.yunxi.vehicle.pojo.VehicleConfigVO;
import com.yunxi.vehicle.pojo.VehicleConfigVerVO;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 工程配置版本明细 服务实现类
 * </p>
 * @author 
 * @since 2019-05-18
 */
@Service
public class VehicleConfigVerServiceImpl extends ServiceImplPlus<VehicleConfigVerMapper, VehicleConfigVer> implements VehicleConfigVerService {

    @Override
    public List<VehicleConfigVO> casList(VehicleConfigVerVO vo) {
        List<VehicleConfigVO> list =  baseMapper.listByType(vo);
        return  list;
    }

    @Override
    public List listByFamliy(String vehicleCode,String familyCode) {
        Map v = new HashMap();
        v.put("vehicleCode",vehicleCode);
        v.put("famliyCode",familyCode);
        List list =  baseMapper.listByFamliy(v);
        return  list;
    }

    @Override
    public List listByColorIn(String vehicleCode) {
        return listByFamliy(vehicleCode,"NNN");
    }

    @Override
    public List listByColorOut(String vehicleCode) {
        return listByFamliy(vehicleCode,"WWW");
    }

    @Override
    public List listByBattary(String vehicleCode) {
        return listByFamliy(vehicleCode,"PWA");
    }

    @Override
    public List listByCountry(String vehicleCode) {
        return listByFamliy(vehicleCode,"MS_");
    }

    @Override
    public List listByYear(String vehicleCode) {
        return listByFamliy(vehicleCode,"MY_");
    }

    @Override
    public boolean delAll() {
        return baseMapper.delete(null) > 0;
    }
}
